using System;
using L=Science.Physics.GeneralPhysics;

namespace Serway.Chapter19
{
	/// <summary>
	/// Example03: Expansion of a Railroad Track
	/// A segment of steel railroad track has a length of
	/// 30.000 m when the temperature is 0.0 C.
	/// (A) What is its length when the temperature is 40.0 C?
	/// 30.013 m
	/// (B) Suppose that the ends of the rail are rigidly clamped
	/// at 0.0 C so that expansion is prevented. What is the thermal
	/// stress set up in the rail if its temperature is raised 
	/// to 40.0 C?
	/// F/A = 8.7 \times 10^7 N/m^2
	/// </summary>
	public class Example03
	{
		public Example03()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
			L.Temperature t1 = new L.Temperature();
			t1.C = 0.0;
			L.Temperature t2 = new L.Temperature();
			t2.C = 40.0;
			L.Length oriL = new L.Length();
			oriL.m = 30.0;
			double alpha = 11.0E-6;
			L.Length delL = new L.Length();
			delL.m = alpha*oriL.m*(t2.C - t1.C);
			L.Elasticity obj = new L.Elasticity();
			obj.YoungModulus = 20.0E10;		
			result+=Convert.ToString(oriL.m + delL.m)+"      "
				+Convert.ToString(obj.YoungModulus*delL.m/oriL.m);		
		}
	}
}
